<!--this file is identical copy of _file_info.html but just changes "file." to "sub_file." to allow show the same info as subtab-->
<div class="panel panel-default">
    <table class="table table-striped table-bordered" style="table-layout: fixed;width: 50%;margin-left: auto;margin-right: auto;">
        {% if sub_file.cape_type %}
            <tr>
                <th style="border-top: 0; width: 15%;">Type</th>
                <td style="border-top: 0; word-wrap: break-word;"><b>{{sub_file.cape_type}}</b></td>
            </tr>
        {% endif %}
        <tr>
            <th style="border-top: 0; width: 15%;">Filename</th>
            <td>
                {% for name in sub_file.name|str2list %}
                <div style="border-top: 0; word-wrap: break-word;"><b>{{name|safe}}</b></div>
                {% endfor %}
            </td>
        </tr>
        {% if sub_file.type %}
            <tr>
                <th style="border-top: 0; width: 15%;">File Type</th>
                <td style="border-top: 0; word-wrap: break-word;"><b>{{sub_file.type}}</b></td>
            </tr>
        {% endif %}
        {% if sub_file.guest_paths and tab_name == "dropped" %}
            <tr>
                <th style="border-top: 0; width: 15%;">Associated Filenames</th>
                <td style="border-top: 0; word-wrap: break-word;">
                    {% for path in sub_file.guest_paths|str2list %}
                        <div>{{path}}</div>
                    {% endfor %}
                </td>
            </tr>
        {% endif %}
        <tr>
            <th style="border-top: 0; width: 15%;">File Size</th>
            <td style="border-top: 0; word-wrap: break-word;"><b>{{sub_file.size}} bytes</b></td>
        </tr>
        {% if sub_file.module_path and sub_file.process_path != sub_file.module_path %}
            <tr>
                <th>Module Path</th>
                <td>{{sub_file.module_path}}</td>
            </tr>
        {% endif %}
        {% if sub_file.cape_type_code == 8 or sub_file.cape_type_code == 9 %}
                <tr>
                    <th>Virtual Address</th>
                    <td>{{sub_file.virtual_address}}</td>
                </tr>
            {% endif %}
            {% if sub_file.cape_type_code == 5 %}
                <tr>
                    <th>Section Handle</th>
                    <td>{{sub_file.section_handle}}</td>
                </tr>
            {% endif %}
            {% if sub_file.cape_type_code == 3 or sub_file.cape_type_code == 4 %}
                <tr>
                    <th>Target Process</th>
                    <td>{{sub_file.target_process}}</td>
                </tr>
                <tr>
                    <th>Target PID</th>
                    <td>{{sub_file.target_pid}}</td>
                </tr>
                <tr>
                    <th>Target Path</th>
                    <td>{{sub_file.target_path}}</td>
                </tr>
                <tr>
                    <th>Injecting Process</th>
                    <td>{{sub_file.process_name}}</td>
                </tr>
                <tr>
                    <th>Injecting PID</th>
                    <td>{{sub_file.pid}}</td>
                </tr>
                <tr>
                    <th>Path</th>
                    <td>{{sub_file.process_path}}</td>
                </tr>
            {% else %}
                {% if sub_file.process_name %}
                <tr>
                    <th>Process</th>
                    <td>{{sub_file.process_name}}</td>
                </tr>
                {% endif %}
                {% if sub_file.pid %}
                <tr>
                    <th>PID</th>
                    <td>{{sub_file.pid}}</td>
                </tr>
                {% endif %}
                {% if sub_file.process_path %}
                <tr>
                    <th>Path</th>
                    <td>{{sub_file.process_path}}</td>
                </tr>
                {% endif %}
            {% endif %}
        {% if sub_file.timestamp %}
            <tr>
                <th>PE timestamp</th>
                <td style="word-wrap: break-word;">{{sub_file.timestamp}}</td>
            </tr>
        {% endif %}
        <tr>
            <th>MD5</th>
            <td style="word-wrap: break-word;">{{sub_file.md5}}</td>
        </tr>
        <tr>
            <th>SHA1</th>
            <td style="word-wrap: break-word;">{{sub_file.sha1}}</td>
        </tr>
        <tr>
            <th>SHA256</th>
            <td style="word-wrap: break-word;">{{sub_file.sha256}}
                <a href="https://www.virustotal.com/gui/file/{{sub_file.sha256}}/" style="color: #e74c3c">[VT]</a>
                <a href="https://mwdb.cert.pl/file/{{sub_file.sha256}}" style="color: #e74c3c">[MWDB]</a>
                <a href="https://bazaar.abuse.ch/sample/{{sub_file.sha256}}/" style="color: #e74c3c">[Bazaar]</a>
            </td>
        </tr>
        {% if sub_file.sha3_384 %}
        <tr>
            <th>SHA3-384</th>
            <td style="word-wrap: break-word;">{{sub_file.sha3_384}}</td>
        </tr>
        {% endif %}
        {% if sub_file.rh_hash %}
            <tr>
                <th>RichHeader Hash</th>
                <td style="word-wrap: break-word;">{{sub_file.rh_hash}}</td>
            </tr>
        {% endif %}
        <tr>
            <th>CRC32</th>
            <td>{{sub_file.crc32}}</td>
        </tr>
        {% if sub_file.tlsh %}
        <tr>
            <th>TLSH</th>
            <td style="word-wrap: break-word;">{{sub_file.tlsh}}</td>
        </tr>
        {% endif %}
        <tr>
            <th>Ssdeep</th>
            <td style="word-wrap: break-word;">{{sub_file.ssdeep}}</td>
        </tr>
        {% if sub_file.clamav %}
        <tr>
            <th>ClamAV</th>
            <td>
                <ul style="margin-bottom: 0;">
                {% for sign in sub_file.clamav %}
                    <li>{{sign}}</li>
                {% endfor %}
                </ul>
            </td>
        </tr>
        {% endif %}
        {% if sub_file.yara %}
        <tr>
            <th>Yara</th>
            <td>
                <ul style="margin-bottom: 0;">
                {% for sign in sub_file.yara %}
                    <li>
                    {{sign.name}} - {{sign.meta.description}}
                    {% if sign.meta.author %}
                        - Author: {{sign.meta.author}}
                    {% endif %}
                    </li>
                {% endfor %}
                </ul>
            </td>
        </tr>
        {% endif %}
        {% if sub_file.cape_yara %}
        <tr>
            <th>CAPE Yara</th>
            <td>
                <ul style="margin-bottom: 0;">
                {% for sign in sub_file.cape_yara %}
                    <li>
                    {{sign.name}}
                    {% if sign.meta.cape_type %} - {{sign.meta.cape_type}}
                    {% elif sign.meta.description %} - {{sign.meta.description}}
                    {% endif %}
                    {% if sign.meta.author %} - Author: {{sign.meta.author}}{% endif %}
                    </li>
                {% endfor %}
                </ul>
            </td>
        </tr>
        {% endif %}
        {% if sub_file.trid %}
        <tr>
            <th>TriD</th>
            <td>
            <ul style="margin-top: 0;margin-bottom: 0;">
                {% for str in sub_file.trid %}
                    <li>{{str}}</li>
                {% endfor %}
            </ul>
            </td>
        </tr>
        {% endif %}

        {% if sub_file.die %}
        <tr>
            <th>Detect It Easy</th>
            <td>
            <ul style="margin-top: 0;margin-bottom: 0;">
                {% for str in sub_file.die %}
                    <li>{{str}}</li>
                {% endfor %}
            </ul>
            </td>
        </tr>
        {% endif %}

        {% if sub_file.dropdir %}
        <tr>
            <th></th>
            <td></td>
        </tr>
        {% else %}
        <tr>
            <th>
                {% if file.pe %}<a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#pe_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="pe_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display PE info"><span class="fas fa-file-lines"></span> PE</a>{% endif %}
                {% if file.dotnet %}<a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#dotnet_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="dotnet_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display DotNet info"><span class="fas fa-file-lines"></span> DotNET</a>{% endif %}
                {% if file.pdf %}<a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#pdf_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="pdf_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display PDF info"><span class="fas fa-file-lines"></span> PDF</a>{% endif %}
                {% if file.lnk %}<a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#lnk_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="lnk_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display LNK info"><span class="fas fa-file-lines"></span> LNK</a>{% endif %}
                {% if file.java %}<a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#java_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="java_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display Java info"><span class="fas fa-file-lines"></span> Java</a>{% endif %}
                {% if file.office %}<a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#office_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="office_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display Office info"><span class="fas fa-file-lines"></span> Office</a>{% endif %}
            </th>

            </th>
            <td>
                {% if sub_file.flare_capa %}
                    <a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#flare_capa_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="flare_capa_{{sub_file.sha256}}">FLARE CAPA</a>
                {% endif %}
                {% if sub_file.strings %}
                    <a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#strings_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="strings_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display strings"><span class="fas fa-envelope-open-text"></span> Strings</a>
                {% endif %}
                {% if sub_file.floss %}
                    <a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#floss_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="floss_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display floss strings"><span class="fas fa-envelope-open-text"></span> Floss</a>
                {% endif %}
                {% if sub_file.data %}
                    <a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#text_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="text_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display text"><span class="fas fa-envelope-open-text"></span> Text</a>
                {% endif %}
                {% if sub_file.decoded_files %}
                    <a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#decoded_files_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="decoded_files_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display text"><span class="fas fa-envelope-open-text"></span> {{sub_file.decoded_files_tool}}</a>
                {% endif %}
                {% if sub_file.extracted_files %}
                    <a class="btn btn-secondary btn-sm" data-toggle="collapse" href="#extracted_files_{{sub_file.sha256}}" role="button" aria-expanded="false" aria-controls="extracted_files_{{sub_file.sha256}}"  data-bs-toggle="tooltip" title="Display extracted files"><span class="fas fa-archive"></span> {{sub_file.extracted_files_tool}}</a>
                {% endif %}
            </td>
        </tr>
        {% endif %}
    </table>
    {% if sub_file.flare_capa %}
            <tr>
                <th></th><td>
                <div class="collapse" id="flare_capa_{{sub_file.sha256}}">
                    <div>
                    <!--Inspired by @snemes trick, code placed in web/views/templateatgs/analysis_tags.py-->
                    {% if sub_file.flare_capa.CAPABILITY %}
                        {{sub_file.flare_capa|flare_capa_capability}}
                    {% endif %}
                    {% if sub_file.flare_capa.ATTCK %}
                        {{sub_file.flare_capa|flare_capa_attck}}
                    {% endif %}
                    {% if sub_file.flare_capa.MBC %}
                        {{sub_file.flare_capa|flare_capa_mbc}}
                    {% endif %}
                    </div>
                </div>
            </td>
            </tr>
            </br>
        {% endif %}
        {#
        {% if graphs.vba2graph.content|getkey:sub_file.sha256 %}
            <tr><th></th>
                <td>{{ graphs.vba2graph.content|getkey:sub_file.sha256|safe }}</td>
            </tr>
        {% endif %}
        #}
        {% if sub_file.virustotal %}
            <tr>
                <th></th>
                <td>{% include "generic/_virustotal.html" %}</td>
            </tr>
        {% endif %}
        {% if sub_file.strings %}
            <tr>
                <th></th><td>
                <div class="collapse" id="strings_{{sub_file.sha256}}">
                    <div>
                    {{sub_file.strings|safe}}
                    </div>
                </div>
            </td>
            </tr>
        {% endif %}
        {% if sub_file.data %}
            <tr>
                <th></th><td>
                <div class="collapse" id="text_{{sub_file.sha256}}">
                    <div>
                    <p>{{sub_file.data|escape}}</p>
                    </div>
                </div>
            </td>
            </tr>
        {% endif %}
        {% if sub_file.decoded_files %}
            <tr>
                <th></th><td>
                <div class="collapse" id="decoded_files_{{sub_file.sha256}}">
                    <div>
                    <p>{{sub_file.decoded_files|escape}}</p>
                    </div>
                </div>
            </td>
            </tr>
        {% endif %}
        {% if sub_file.extracted_files %}
            <tr>
                <th></th><td>
                <div class="collapse" id="extracted_files_{{sub_file.sha256}}">
                    <div>
                        {% for sub_file in sub_file.extracted_files %}
                            {% include "generic/_sub_file_info.html" %}
                        {% endfor %}
                    </div>
                </div>
            </td>
            </tr>
            </br>
        {% endif %}
    {#
        {% if sub_file.pe %} <div class="collapse" id="pe_{{sub_file.sha256}}"> <div> {% include "generic/_pe.html" %}</div></div></br>{% endif %}
        {% if sub_file.dotnet %} <div class="collapse" id="dotnet_{{sub_file.sha256}}"> <div> {% include "generic/_dotnet.html" %}</div></div></br>{% endif %}
        {% if sub_file.pdf %} <div class="collapse" id="pdf_{{sub_file.sha256}}"> <div> {% include "generic/_pdf.html" %}</div></div></br>{% endif %}
        {% if sub_file.lnk %} <div class="collapse" id="lnk_{{sub_file.sha256}}"> <div> {% include "generic/_lnk.html" %}</div></div></br>{% endif %}
        {% if sub_file.java %} <div class="collapse" id="java_{{sub_file.sha256}}"> <div> {% include "generic/_java.html" %}</div></div></br>{% endif %}
        {% if sub_file.office %} <div class="collapse" id="office_{{sub_file.sha256}}"> <div> {% include "generic/_office.html" %}</div></div></br>{% endif %}
        {% if sub_file.floss %} <div class="collapse" id="floss_{{sub_file.sha256}}"> <div> {% include "generic/_floss.html" %}</div></div></br>{% endif %}
        {% if graphs.bingraph.enabled and graphs.bingraph.content|getkey:sub_file.sha256 %}<center><td>{{ graphs.bingraph.content|getkey:sub_file.sha256|safe }}</td></center></br>{% endif %}
    #}
</div>
